﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.workers {
    import flash.utils.*;
    import Classes.*;

    public class CopsNBanditsWorkers extends Workers {

        public function getState(_arg1:int):String{
            return (getWorkerData(_arg1, CopData.COP_STATE, ""));
        }
        public function setState(_arg1:int, _arg2:String):void{
            setWorkerData(_arg1, CopData.COP_STATE, _arg2);
        }
        public function getTimestamp(_arg1:int):uint{
            return (uint(getWorkerData(_arg1, CopData.TIMESTAMP, 0)));
        }
        public function setTimestamp(_arg1:int, _arg2:uint):void{
            setWorkerData(_arg1, CopData.TIMESTAMP, _arg2);
        }
        public function setNpcOwner(_arg1:int, _arg2:NPC):void{
            setWorkerData(_arg1, CopData.COP_REF, _arg2);
        }
        public function getNpcOwner(_arg1:NPC):CopData{
            var _local2:int;
            while (_local2 < getWorkerCount()) {
                if (m_workers[_local2].data[CopData.COP_REF] == _arg1){
                    return (this.getCopData(_local2));
                };
                _local2++;
            };
            return (null);
        }
        public function getMultipleNpcOwners(_arg1:Array):Array{
            var _local3:NPC;
            var _local4:CopData;
            var _local2:Array = [];
            for each (_local3 in _arg1) {
                _local4 = this.getNpcOwner(_local3);
                if (_local4 != null){
                    _local2.push(_local4);
                };
            };
            return (_local2);
        }
        public function getAllCopData():Array{
            var _local3:Dictionary;
            var _local4:CopData;
            var _local1:Array = new Array();
            var _local2:int;
            while (_local2 < getWorkerCount()) {
                _local3 = m_workers[_local2].data;
                _local4 = new CopData(_local3, m_workers[_local2].zid, _local2);
                _local1.push(_local4);
                _local2++;
            };
            return (_local1);
        }
        public function getCopData(_arg1:int):CopData{
            return (((_arg1 > -1)) ? new CopData(m_workers[_arg1].data, m_workers[_arg1].zid, _arg1) : null);
        }
        public function setCopData(_arg1:CopData):void{
            var _local2:Dictionary = new Dictionary();
            _local2[CopData.COP_STATE] = _arg1.getState();
            _local2[CopData.TIMESTAMP] = _arg1.getTimestamp();
            _local2[CopData.COP_REF] = _arg1.getCopReference();
            m_workers[_arg1.getPosition()].data = _local2;
        }

    }
}//package Modules.workers 
